package com.atguigu.springboot.config;

import com.google.common.collect.Lists;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @author : wenchao.long
 * @date : Created in 2020/11/26 15:08 周四
 * @description :
 */
@Configuration
public class MyCacheConfig {

    @Bean("myKeyGenerator")
    public KeyGenerator keyGenerator() {
        return (target, method, params) -> method.getName() + "[" + Lists.newArrayList(params).toString() + "]";
    }
}
